package com.project.class8_30.lambda;

import com.lovo.netCRM.component.LovoButton;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class EventFrame extends JFrame {

    public EventFrame(){
        this.setLayout(null);

        LovoButton okButton = new LovoButton("确定",50,50,this);
        okButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                System.out.println("点击确定");
            }
        });

        LovoButton addButton = new LovoButton("添加",50,80,this);
        addButton.addActionListener(e -> System.out.println("点击添加"));

        this.setSize(600,400);
        this.setVisible(true);
        this.setDefaultCloseOperation(3);
        this.setLocationRelativeTo(null);
    }

    public static void main(String[] args) {
        new EventFrame();
    }
}
